home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group95b.txt / 000081_icon-group-sender _Mon Jul 10 17:24:00 1995.msg < prev    next >
Internet Message Format  |  1995-09-18  |  1KB

  1. Received: by cheltenham.cs.arizona.edu; Mon, 10 Jul 1995 16:07:36 MST
  2. Message-Id: <9507101724.AA28967@ns1.computek.net>
  3. Mime-Version: 1.0
  4. Content-Length: 703
  5. Content-Type: text/plain
  6. Content-Transfer-Encoding: 7bit
  7. Date: Mon, 10 Jul 95 17:24 CDT
  8. From: gep2@computek.net
  9. Subject: DOS delay routine
  10. To: icon-group@cs.arizona.edu
  11. X-Mailer: SPRY Mail Version: 04.00.06.17
  12. Errors-To: icon-group-errors@cs.arizona.edu
  13.  
  14. >...I needed something to wait about 5 min. between checkups do I wrote
  15. a little delay route that waits in a little key sensing loop.
  16.  
  17. # provide a time delay to limited amount of collected data
  18. #
  19. procedure delay(n)
  20.   target := n * 250000         # approx 5 min intervals
  21.   every i:= 1 to target do
  22.     {
  23.     if kbhit() then
  24.       {
  25.       kee := getch()
  26.       if kee == "\e" then halt("ESCAPED!")
  27.       }
  28.     22.0000/7.0000000
  29.     }
  30.   end
  31.  
  32. I'm curious why you didn't use &time or &clock to do this kind of thing, rather 
  33. than just counting loop iterations or the like... if for no other reason than 
  34. making your routine processor-speed-insensitive!
  35.  
  36. Gordon Peterson
  37. http://www.computek.net/public/gep2/
  38.  
  39.